<?php
defined("_VALID_ACCESS") || die('Direct access forbidden');
    class Eyeworx_PatientRecords_PatientInstall extends ModuleInstall {

        public function install() {
            try {
                $rbopatient_recordset = new Eyeworx_PatientRecords_Patient_RBO_RBOPatient();
                $rbopatient_recordset->install();
                $rbopatient_recordset->add_default_access();
                $rbopatient_recordset->set_caption('Patient');
            } catch (Exception $e) {
                return false;
            }
            return true;
        }

        public function uninstall() {
            try {
                $rbopatient_recordset = new Eyeworx_PatientRecords_Patient_RBO_RBOPatient();
                $rbopatient_recordset->uninstall();

//                $rboeyes_recordset = new Eyeworx_PatientRecords_Eyes_RBO_RBOEyes();
//                $rboeyes_recordset->uninstall();

////                Utils_RecordBrowserCommon::delete_addon('patient', 'Eyeworx/PatientRecords/Eyes', 'display_eyes_info');
//                Utils_CommonDataCommon::remove('Eyeworx/PatientRecords/Eyes/lens');
//                Utils_CommonDataCommon::remove('Eyeworx/PatientRecords/Eyes/unit');
            } catch (Exception $e) {
                return false;
            }
            return true;
        }

        public function requires($v) {
            return array(
                array('name'=>'Base/Lang','version'=>0),
                array('name'=>'Utils/RecordBrowser','version'=>0),
//                array('name'=>'Eyeworx/PatientRecords/Eyes', 'version'=>0)
            );
        }

        public function info() {
            return array(
                'Author'=>'Velicaria, Maureen D.',
                'Description'=>'Patient Personal Information'
            );
        }

        public function version() {
            return array('1.0');
        }

        public function simple_setup() {
            return array('package'=>__('Eyeworx'), 'option'=>__('Patient'));

        }

    }

?>